/*
 * @Author: yangrongxin
 * @Date: 2021-06-07 16:48:31
 * @LastEditors: yangrongxin
 * @LastEditTime: 2021-08-16 16:06:06
 */
import { useContext } from 'react';
import Taro from '@tarojs/taro';
import { View, Text, Image } from '@tarojs/components';
import styles from '../../index.module.less';

const ArticleItem = ({
  articleId,
  title,
  subhead,
  // content, // 文章中的内容 点击之后存到store中 用于新页面进行展示
  cover = 'https://hxgywx.oss-cn-shenzhen.aliyuncs.com/nursing-customer/assets/articleVideoCover.png',
  readCount,
}) => {
  return (
    <View
      className={styles.articleItem}
      onClick={() => {
        Taro.navigateTo({
          url: `/pages/PatientEducation/components/ArticleContent/index?articleId=${articleId}`,
        });
      }}
    >
      <View>
        <Text>{title}</Text>
        <Text>{subhead}</Text>
        <View>
          <Text>{readCount}浏览</Text>
        </View>
      </View>
      <Image src={cover} />
    </View>
  );
};

export default ArticleItem;
